<template>
  <div>
    <DynamicForm :config="config" :questions="questions"></DynamicForm>
  </div>
</template>

<script setup lang="ts">
import { reactive, computed } from 'vue';
import { DynamicForm } from '@/components/public-template';
import formService from './form.service';
import { formInfoStore } from '@/store/modules/form';
const formStore = formInfoStore();

let config: any = {
  queryUrl: 'TokenAuth/Authenticate',
  addUrl: 'TokenAuth/Authenticate',
  combinationMethod(data: any) {
    console.log('提交时候拦截', data);
    return data;
  },
  beforeWithMethod(data: any) {
    return data;
  }
};

formStore.setQuestions(reactive(formService.getQuestions()));
let questions: any = computed(() => formStore.getQuestions);
</script>

<style lang="less" scoped></style>
